import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui';
import  VueResource  from 'vue-resource';
import './style/index.css'
import 'element-ui/lib/theme-chalk/index.css';
import router from './router'
import store from './store/index.js'

Vue.use(ElementUI);
Vue.use(VueResource);
Vue.config.productionTip = false


//设置全局http参数
Vue.http.options.root="http://42.194.149.226:8899/"
Vue.http.options.emulateJSON=true

// 设置全局时间格式
Vue.filter("dateFormat", function (date) {
  let datef = new Date(date);
  let year = datef.getFullYear();
  let month = (datef.getMonth() + 1).toString().padStart(2, '0');
  let day = (datef.getDate()).toString().padStart(2, '0');
  let h = (datef.getHours()).toString().padStart(2, '0');
  let m = (datef.getMinutes()).toString().padStart(2, '0');
  let s = (datef.getSeconds()).toString().padStart(2, '0');
  //  console.log(year);
  return `${year}年${month}月${day}日 ${h}:${m}:${s}`
})

new Vue({
  render: h => h(App),
  router,
  store
}).$mount('#app')
